**Replication Do File, Main Manuscript Results**
**Data: main.dta
**Variables: main variables for all models

use "main.dta"

**Note: pctelect and pctelect1 are identical variables, where pctelect1 is pctelect/10
**see:
corr pctelect1 pctelect

**pctelect1 is used in the models, pctelect is presented in Table 2 so it is easier to understand


**Table 2**
use "main.dta"

**points of prof based on median splits -- as text explains, professionalism is dichotomized for this test alone
**producing the percentages
su pctelect if ambiguity==1 // produces unbalanced + low prof
su pctelect if ambiguity==2 //produces balanced + low prof
su pctelect if ambiguity==3 // produces balanced + high prof
su pctelect if ambiguity==4 //produces unbalanced + high prof


**Significance comparisons [note in-text differences vary slighty due to rounding] 
ttest pctelect if (ambiguity==2|ambiguity==3), by(ambiguity) // produces difference between high ambiguity and balance/low
ttest pctelect if (ambiguity==1|ambiguity==3), by(ambiguity) // produces difference between high ambiguity and unbalanced/low
ttest pctelect if (ambiguity==4|ambiguity==3), by(ambiguity) // produces difference between high ambiguity and unbalanced/high 

**Table 3**
use "main.dta"
**Notes, in-text Table 3 suppresses the year coefficients
**Note: in the manuscript the interaction appears first in the table, but in the log file the interaction appears after the the constituent terms as this is the raw Stata output. 
**Full coefficients shown in SI Table 1.1, Model 1
reg pctelect1 i.balance01##c.prof unemployment termlim  tleffect redist  mmds chpart fraction divgov  pres2 y1982 y1984 y1986 y1988 y1990 y1992 y1994 y1996 

**Figure 1**
use "main.dta"
**based on running Table 3 model
reg pctelect1 i.balance01##c.prof unemployment termlim  tleffect redist  mmds chpart fraction divgov  pres2 y1982 y1984 y1986 y1988 y1990 y1992 y1994 y1996 

**note xmargins and notes were adjusted manually 
margins, dydx (balance01) at(prof=(0.064 (0.005) 0.332)) level(95)
marginsplot, yline(0) recast(line) recastci(rline) ciopts(lpattern(dash)) xlabel(0.067 0.332) title("") xtitle("Professionalism") ytitle ("Effect of Balance")graphregion(fcolor(white)) plotopts(lcolor(black))  ci1opts(lcol(black))
graph save Graph "Figure1.gph", replace


**Figure 2
use "main.dta"
**Figure 2 is based on the following model, which is included in full in the supplementary information SI Table 2.1 (Model 1)
reg pctelect1 i.balance01##c.prof##c.unemployment termlim  tleffect redist mmds chpart fraction divgov pres2 y1982 y1984 y1986 y1988 y1990 y1992 y1994 y1996 
**Figure color was slightly adjusted manually in stata
margins, dydx (balance01) at(prof=(0.067 (0.05) 0.332) unemployment = (-1.3)) level(95)
marginsplot, yline(0) recast(line) recastci(rline) ciopts(lpattern(dash)) xlabel(0.064  0.332) ylabel(-1 (0.5) 0.5)  graphregion(fcolor(white)) title("Economic Gains") xtitle("Professionalism") ytitle ("Effect of Balance") graphregion(fcolor(white)) plotopts(lcolor(black))  ci1opts(lcol(black))
graph save Graph "leftpanel.gph", replace

margins, dydx (balance01) at(prof=(0.067 (0.05) 0.332) unemployment = (0.4)) level(95)
marginsplot, yline(0) recast(line) recastci(rline) ciopts(lpattern(dash)) xlabel(0.064  0.332) ylabel(-1 (0.5) 0.5) graphregion(fcolor(white)) title("Economic Losses") xtitle("Professionalism") ytitle ("Effect of Balance") graphregion(fcolor(white)) plotopts(lcolor(black))  ci1opts(lcol(black))
graph save Graph "rightpanel.gph", replace

gr combine leftpanel.gph rightpanel.gph , graphregion(fcolor(white) ilcolor(white) m(white) istyle(white)) xcommon 
graph save Graph "Figure2.gph", replace

**Figure 3 
use "main.dta"
**Figure 3 is based on the following model, which is included in full in the supplementary information (Identical to Figure 2 model, SI Table 2.1 (Model 1))
reg pctelect1 i.balance01##c.prof##c.unemployment termlim  tleffect redist mmds chpart fraction divgov pres2 y1982 y1984 y1986 y1988 y1990 y1992 y1994 y1996 
**Figure Top Panel, bottom 25%, xaxis and color are manually adjusted
margins, dydx (balance01) at(unemployment=(-1.3 (0.1) 0.4) prof=(0.113)) level(95)
marginsplot, yline(0) recast(line) recastci(rline) ciopts(lpattern(dash)) xlabel(-1.3 0.4) title("Bottom 25% of Professionalism") xtitle("Unemployment Change") ytitle ("Effect of Balance")graphregion(fcolor(white)) plotopts(lcolor(black))  ci1opts(lcol(black))
graph save Graph "Figure3a.gph", replace

**Figure Bottom Panel, top 25%, xaxis and color are manually adjusted
margins, dydx (balance01) at(unemployment=(-1.3 (0.1) 0.4) prof=(0.236)) level(95)
marginsplot, yline(0) recast(line) recastci(rline) ciopts(lpattern(dash)) xlabel(-1.3  0.4) title("Top 25% of Professionalism") xtitle("Unemployment Change") ytitle ("Effect of Balance")graphregion(fcolor(white)) plotopts(lcolor(black))  ci1opts(lcol(black))
graph save Graph "Figure3b.gph", replace

